const obj: { x: number; y: number } = {
  x: 1,
  y: 2,
}

type MyObj = {
  x: number
  y: number
}

// const o1: MyObj = { x: 1 }
const o2: MyObj = { x: 1, y: 2 }

// console.log(o2.z)

const obj2: { x: number; y: number; add(x: number, y: number): number } = {
  x: 1,
  y: 2,
  add(x, y) {
    return x + y
  },
}

type User = {
  name: string
  age: number
}

type Name = User['name']

interface IUser {
  name: string
  age: number
}

const obj3: IUser = {
  name: 'Jetwang',
  age: 25,
}

interface MyInterface {
  toString(): string
  prop: number
}

const obj4: MyInterface = {
  prop: 123
}
